<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      html,
      body {
        margin: 0;
        padding: 0 30px;
      }
      h5 {
        margin-bottom: 0px;
      }
      .container,
      .container1,
      .container2,
      .container3,
      .container4 {
        display: flex;
        width: 600px;
        height: 160px;
        font-size: 20px;
        line-height: 100px;
        margin-bottom: 26px;
        border: 6px solid tomato;
        color: white;
        text-align: center;
      }
      .container-item,
      .container1-item {
        height: 100px;
        width: 100px;
      }
      .container2-item,
      .container3-item,
      .container5-item {
        width: 300px;
        height: 100px;
      }
      .container-item:nth-child(1),
      .container2-item:nth-child(1),
      .container4-item:nth-child(1) {
        flex-shrink: 1;
        background: yellowgreen;
      }
      .container-item:nth-child(2),
      .container2-item:nth-child(2),
      .container4-item:nth-child(2) {
        flex-shrink: 1;
        background: rgb(53, 98, 158);
      }
      .container-item:nth-child(3),
      .container2-item:nth-child(3),
      .container4-item:nth-child(3) {
        flex-shrink: 1;
        background: rgb(65, 21, 77);
      }
      .container-item:nth-child(4) {
        background: rgb(91, 117, 30);
      }
      .container-item:nth-child(5) {
        background: rgb(5, 22, 44);
      }
      .container-item:nth-child(6) {
        background: rgb(104, 69, 114);
      }
      .container-item:nth-child(7) {
        background: rgb(54, 44, 9);
      }
      .container1-item:nth-child(1),
      .container3-item:nth-child(1) {
        flex-shrink: 1;
        background: yellowgreen;
      }
      .container1-item:nth-child(2),
      .container3-item:nth-child(2) {
        flex-shrink: 2;
        background: rgb(53, 98, 158);
      }
      .container1-item:nth-child(3),
      .container3-item:nth-child(3) {
        flex-shrink: 1;
        background: rgb(65, 21, 77);
      }
      .container5-item:nth-child(1) {
        flex-shrink: 1;
        background: yellowgreen;
      }
      .container5-item:nth-child(2) {
        flex-shrink: 0;
        background: rgb(53, 98, 158);
      }
      .container5-item:nth-child(3) {
        flex-shrink: 1;
        background: rgb(65, 21, 77);
      }
    </style>
  </head>
  <body>
    <h5>1.容器宽度为600px，每个项目宽度为100px</h5>
    <div class="container">
      <div class="container-item">1</div>
      <div class="container-item">1</div>
      <div class="container-item">1</div>
    </div>
    <div class="container1">
      <div class="container1-item">1</div>
      <div class="container1-item">2</div>
      <div class="container1-item">1</div>
    </div>
    <h5>2.容器宽度为600px，每个项目宽度为300px</h5>
    <div class="container2">
      <div class="container2-item">1</div>
      <div class="container2-item">1</div>
      <div class="container2-item">1</div>
    </div>
    <div class="container3">
      <div class="container3-item">1</div>
      <div class="container3-item">2</div>
      <div class="container3-item">1</div>
    </div>
    <div class="container3">
      <div class="container5-item">1</div>
      <div class="container5-item">0</div>
      <div class="container5-item">1</div>
    </div>
    <h5>3.容器宽度为600px，每个项目宽度和高度为0</h5>
    <div class="container4">
      <div class="container4-item">1</div>
      <div class="container4-item">2</div>
      <div class="container4-item">1</div>
    </div>
  </body>
</html>
